const MongoClient=require('mongodb').MongoClient;
 let mydb=null;
var url = 'mongodb://localhost:27017/bjhm';
MongoClient.connect(url, function(err, db) {
  console.log(db);
   mydb=db; 
});
exports.findOne=(collectionName,collectionCondition,callback)=>{
  mydb.collection.find(collectionName,collectionCondition,(err,doc)=>{
    if(err){
      console.log(err)
    }
    callback(err,doc);
  })
}
exports.findList=(collectionName,collectionCondition,callback)=>{
  mydb.collection(collectionName).find(collectionCondition).toArray(function(err, docs) {
    callback(err,docs);
  });
}



